package com.c1802.action;

import com.c1802.dao.Impl.UserDaoImpl;
import com.c1802.dao.UserDao;
import com.opensymphony.xwork2.ActionSupport;

public class UpdateAction extends ActionSupport {
    private int id;
    private String uname;
    private String upass;

    @Override
    public String execute() throws Exception {
        System.out.println(id+"--"+uname+"--"+upass);
        UserDao dao=new UserDaoImpl();
        int num=dao.UpdateUser(id,uname,upass);
        if (num>0)
        {
            System.out.println("修改成功");
            return "success";
        }else {
            System.out.println("修改失败");
            return "error";
        }

    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getUpass() {
        return upass;
    }

    public void setUpass(String upass) {
        this.upass = upass;
    }
}
